package com.yxc.plan.wolf.controller;

import com.yxc.plan.wolf.common.ServerResponse;
import com.yxc.plan.wolf.domain.User;
import com.yxc.plan.wolf.domain.po.LoginPO;
import com.yxc.plan.wolf.service.interfaces.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description :
 * @Author : abc@vanke.com
 * @Date : 2018/12/10 3:19 PM
 */

@RestController
@RequestMapping(value = "/api/v1/user")
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping("/login")
    public ServerResponse<User> login(@RequestBody LoginPO loginPO) {
        return userService.findByPhone(loginPO);
    }

}
